Google Apps Script函式庫
「Libraries」
貼上script id
追加
1ReeQ6WO8kKNxoaA_O0XEQ589cIrRvEBA9qcWpNqdOP17i47u6N9M5Xh0
code:gs(javascript)
function getContent_(url) {
return UrlFetchApp.fetch(url).getContentText()
}
const $ = Cheerio.load(content);
Logger.log($('#mp-right').text());
1Bnt8-tN4ddGVzXXIkzV_AtuuMzdlmlSyKWO7KS4TAVQYgM2GJT5WC9eU
code:test.gs(javascript)
const exports = GASUnit.exports
const assert = GASUnit.assert
function test() {
exports({
'sum': {
'1 + 2 = 3': () => {
assert(sum(1, 2) === 3)
},
},
'hello': {
'Hello world!': () => {
assert(hello('world!') === 'Hello world!')
}
}
})
}